package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.R;
import com.zzyl.nursing.dto.UserLoginRequestDto;
import com.zzyl.nursing.service.IFamilyMemberService;
import com.zzyl.nursing.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zzyl.common.core.controller.BaseController;

/**
 * 老人家属Controller
 * 
 * @author LiuLi
 * @date 2025-08-20
 */
@Api(tags = "老人家属管理")
@Slf4j
@RestController
@RequestMapping("/member/user")
public class FamilyMemberController extends BaseController
{

    @Autowired
    private IFamilyMemberService familyMemberService;




    /**
     * 登录
     */
    @ApiOperation("登录")
    @PostMapping("/login")
    public R<LoginVo> login(@ApiParam("用户登录信息") @RequestBody UserLoginRequestDto userLoginRequestDto)
    {
        log.info("用户登录：{}", userLoginRequestDto);
        return R.ok(familyMemberService.login(userLoginRequestDto));
    }














//    @Autowired
//    private IFamilyMemberService familyMemberService;
//
//    /**
//     * 查询老人家属列表
//     */
//    @ApiOperation("查询老人家属列表")
//    @PreAuthorize("@ss.hasPermi('nursing:member:list')")
//    @GetMapping("/list")
//    public TableDataInfo<List<FamilyMember>> list(@ApiParam("老人家属查询条件") FamilyMember familyMember)
//    {
//        startPage();
//        List<FamilyMember> list = familyMemberService.selectFamilyMemberList(familyMember);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出老人家属列表
//     */
//    @ApiOperation("导出老人家属列表")
//    @PreAuthorize("@ss.hasPermi('nursing:member:export')")
//    @Log(title = "老人家属", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(@ApiParam(value = "老人家属查询条件") HttpServletResponse response, FamilyMember familyMember)
//    {
//        List<FamilyMember> list = familyMemberService.selectFamilyMemberList(familyMember);
//        ExcelUtil<FamilyMember> util = new ExcelUtil<FamilyMember>(FamilyMember.class);
//        util.exportExcel(response, list, "老人家属数据");
//    }
//
//    /**
//     * 获取老人家属详细信息
//     */
//    @ApiOperation("获取老人家属详细信息")
//    @PreAuthorize("@ss.hasPermi('nursing:member:query')")
//    @GetMapping(value = "/{id}")
//    public R<FamilyMember> getInfo(@ApiParam("老人家属ID") @PathVariable("id") Long id)
//    {
//        return R.ok(familyMemberService.selectFamilyMemberById(id));
//    }
//
//    /**
//     * 新增老人家属
//     */
//    @ApiOperation("新增老人家属")
//    @PreAuthorize("@ss.hasPermi('nursing:member:add')")
//    @Log(title = "老人家属", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@ApiParam("老人家属信息") @RequestBody FamilyMember familyMember)
//    {
//        return toAjax(familyMemberService.insertFamilyMember(familyMember));
//    }
//
//    /**
//     * 修改老人家属
//     */
//    @ApiOperation("修改老人家属")
//    @PreAuthorize("@ss.hasPermi('nursing:member:edit')")
//    @Log(title = "老人家属", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@ApiParam("老人家属信息") @RequestBody FamilyMember familyMember)
//    {
//        return toAjax(familyMemberService.updateFamilyMember(familyMember));
//    }
//
//    /**
//     * 删除老人家属
//     */
//    @ApiOperation("删除老人家属")
//    @PreAuthorize("@ss.hasPermi('nursing:member:remove')")
//    @Log(title = "老人家属", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@ApiParam("老人家属ID数组") @PathVariable Long[] ids)
//    {
//        return toAjax(familyMemberService.deleteFamilyMemberByIds(ids));
//    }
}
